package com.lanyun.aicorrectassistant.controller.admin.aiModel;

import com.lanyun.aicorrectassistant.basic.bean.PageResult;
import com.lanyun.aicorrectassistant.basic.bean.Result;
import com.lanyun.aicorrectassistant.controller.admin.aiModel.vo.AiModelRequestPageVO;
import com.lanyun.aicorrectassistant.controller.admin.aiModel.vo.AiModelRequestVO;
import com.lanyun.aicorrectassistant.controller.admin.aiModel.vo.AiModelResponseVO;
import com.lanyun.aicorrectassistant.domain.aiModel.AiModelDomainService;

import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;


/**
 * 大模型信息表（管理员维护）控制器
 * @author Jqchan
 * @version 1.0
 * @date 2025-05-29 23:26:25
 */
@RequestMapping("/api-admin/aiModel")
@RestController("adminAiModelController")
@Slf4j
public class AiModelController {

    @Resource
    private AiModelDomainService aiModelDomainService;

    /**
     * 分页查询大模型信息表（管理员维护）
     */
    @PostMapping("/page")
    public Result<PageResult<AiModelResponseVO>> page(@RequestBody AiModelRequestPageVO requestPageVO) {
        return Result.success(aiModelDomainService.page(requestPageVO));
    }

    /**
     * 新增大模型信息表（管理员维护）
     */
    @PostMapping("/create")
    public Result<Boolean> create(@RequestBody AiModelRequestVO requestVO) {
        return Result.success(aiModelDomainService.insert(requestVO));
    }

    /**
     * 修改大模型信息表（管理员维护）
     */
    @PostMapping("/update")
    public Result<Boolean> update(@RequestBody AiModelRequestVO requestVO) {
        return Result.success(aiModelDomainService.update(requestVO));
    }

    /**
     * 删除大模型信息表（管理员维护）
     */
    @DeleteMapping("/delete/{id}")
    public Result<Boolean> delete(@PathVariable("id") Integer id) {
        return Result.success(aiModelDomainService.delete(id));
    }

    /**
     * 获取大模型信息表（管理员维护）详情
     */
    @GetMapping("/get/{id}")
    public Result<AiModelResponseVO> get(@PathVariable("id") Integer id) {
        return Result.success(aiModelDomainService.get(id));
    }
}
